Skip to main content

MintedNormalTGE

MintedNormalTGE

Note sale for JOT

registry

contract Registry registry

pool

address pool

Pool address which this sale belongs to

hasStarted

bool hasStarted

token

address token

The token being sold

currency

address currency

The token being sold

firstNoteTokenMintedTimestamp

uint256 firstNoteTokenMintedTimestamp

Timestamp at which the first asset is collected to pool

_currencyRaised

uint256 _currencyRaised

Amount of currency raised

tokenRaised

uint256 tokenRaised

Amount of token raised

totalCap

uint256 totalCap

Target raised currency amount

minBidAmount

uint256 minBidAmount

Minimum currency bid amount for note token

initialAmount

uint256 initialAmount

openingTime

uint256 openingTime

_currencyRaisedByInvestor

mapping(address => uint256) _currencyRaisedByInvestor

isOpen

function isOpen() public view returns (bool)

initialize

function initialize(contract Registry _registry, address _pool, address _token, address _currency, uint256 _openingTime) public

securitizationPoolRestricted

modifier securitizationPoolRestricted()

smpRestricted

modifier smpRestricted()

currencyRaisedByInvestor

function currencyRaisedByInvestor(address investor) public view returns (uint256)

This function returns the amount of currency raised by a specific investor.

Parameters

NameTypeDescription
investoraddressThe address of the investor.

Return Values

NameTypeDescription
[0]uint256The amount of currency raised by the investor.

setMinBidAmount

function setMinBidAmount(uint256 _minBidAmount) external

Function to set minimum bid amount

Parameters

NameTypeDescription
_minBidAmountuint256The new minimum bid amount

setHasStarted

function setHasStarted(bool _hasStarted) public

_This function allows the owner or securitization manager to set whether the TGE has started.

Requirements:

  • The caller must have either OWNERROLE or be the SecuritizationManager.

Parameters

NameTypeDescription
_hasStartedboolA boolean indicating if the TGE has started.

setOpeningTime

function setOpeningTime(uint256 _openingTime) external

_Allows the owner or manager to set the opening time for the token sale.

Requirements:

  • The caller must have either OWNERROLE or be the securitization manager.

Parameters

NameTypeDescription
_openingTimeuint256The timestamp when the token sale will start.

onRedeem

function onRedeem(uint256 currencyAmount) public virtual

Function for redeeming currency from the TGE contract. The caller must be the Note token vault, and the amount of raised currency is reduced by the specified amount.

Parameters

NameTypeDescription
currencyAmountuint256Amount to be deducted from _currencyRaised.

getTokenRemainAmount

function getTokenRemainAmount() public view returns (uint256)

Returns the amount of tokens remaining in this contract's balance.

Return Values

NameTypeDescription
[0]uint256The number of tokens remaining in this contract's balance.

getTokenPrice

function getTokenPrice() public view returns (uint256)

Calculates the token price for a given pool and token.

Return Values

NameTypeDescription
[0]uint256The calculated token price.

getTokenAmount

function getTokenAmount(uint256 currencyAmount) public view returns (uint256)

Calculates the amount of tokens that can be minted for a given currency amount.

Parameters

NameTypeDescription
currencyAmountuint256The amount of currency to convert into tokens.

Return Values

NameTypeDescription
[0]uint256The number of tokens that can be minted from the provided currency amount.

_preValidatePurchase

function _preValidatePurchase(address beneficiary, uint256 currencyAmount, uint256 tokenAmount) internal view virtual

_Validates that the purchase meets all requirements before minting tokens.

Requirements:

  • Sale must have started.
  • Currency amount should be greater than or equal to minBidAmount.
  • Beneficiary address cannot be zero.
  • Token amount cannot be 0.
  • Currency amount should not exceed the total cap._

Parameters

NameTypeDescription
beneficiaryaddressThe address receiving the tokens.
currencyAmountuint256Amount of currency being used to purchase.
tokenAmountuint256Number of tokens being minted.

_deliverTokens

function _deliverTokens(address beneficiary, uint256 tokenAmount) internal

This function mints new tokens to an address and sets up the opening block timestamp if this is the first note token being minted.

Parameters

NameTypeDescription
beneficiaryaddressThe address that will receive the newly minted tokens.
tokenAmountuint256The amount of tokens to be minted.

_claimPayment

function _claimPayment(address payee, uint256 currencyAmount) internal

This internal function is used to claim payment. It transfers the specified amount of currency from the payee to the contract address using transferFrom method of ERC20 standard.

Parameters

NameTypeDescription
payeeaddressThe address that will receive the payment.
currencyAmountuint256The amount of currency being transferred.

_forwardFunds

function _forwardFunds(address beneficiary, uint256 currencyAmount) internal

Transfers currencyAmount tokens to beneficiary address. Requires that the contract has enough balance in terms of ERC20 token.

Parameters

NameTypeDescription
beneficiaryaddressThe address where the currency will be sent.
currencyAmountuint256The amount of currency to send.

currencyRaised

function currencyRaised() public view virtual returns (uint256)

Returns the total amount of currency that has been raised so far.

The _currencyRaised variable holds this information.

Return Values

NameTypeDescription
[0]uint256uint256 - Total amount of currency raised in wei.

isDistributedFully

function isDistributedFully() public view returns (bool)

Checks if the total amount of currency raised is equal to the total cap.

This comparison is made between the _currencyRaised variable and the totalCap variable.

Return Values

NameTypeDescription
[0]boolbool - True if the total amount of currency raised equals the total cap, False otherwise.

getCurrencyRemainAmount

function getCurrencyRemainAmount() public view virtual returns (uint256)

Calculates the remaining amount of currency available for purchase.

This calculation subtracts the _currencyRaised variable from the totalCap variable.

Return Values

NameTypeDescription
[0]uint256uint256 - Remaining amount of currency in wei that can still be purchased.

setTotalCap

function setTotalCap(uint256 cap_) external

Allows owner or manager to set total cap for minting

Parameters

NameTypeDescription
cap_uint256The new total cap

_setTotalCap

function _setTotalCap(uint256 cap) internal

_Set the total cap of the token sale. Requirements:

  • The new cap must be greater than zero.
  • The new cap must be equal to or higher than the amount that has already been raised. Emits an {UpdateTotalCap} event._

totalCapReached

function totalCapReached() public view returns (bool)

Checks if the total amount of currency raised is greater than or equal to the total cap

isUnderTotalCap

function isUnderTotalCap(uint256 currencyAmount) public view returns (bool)

Checks if the sum of the current currency raised and the specified currency amount is less than or equal to the total cap

setInitialAmount

function setInitialAmount(uint256 _initialAmount) external

Setup initial amount currency raised for JOT condition

Parameters

NameTypeDescription
_initialAmountuint256Expected minimum amount of JOT before SOT start

buyTokens

function buyTokens(address payee, address beneficiary, uint256 currencyAmount) public returns (uint256)

Function to buy tokens from the TGE contract

Parameters

NameTypeDescription
payeeaddressThe address that receives payment
beneficiaryaddressThe address that receives the purchased tokens
currencyAmountuint256The amount of currency to be paid by the investor

Return Values

NameTypeDescription
[0]uint256tokenAmount The number of tokens bought by the investor